package Cn.Sarkar.IMS.DataBaseDefinations

import Cn.Sarkar.Entities.Common.Table
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.*

abstract class Trades(TableName: String) : Table(TableName) {
    val ApplicationDomainID = intColumn("ApplicationDomainID") reference IMSApplicationDomains.ID comment "Application Domain"
    val WeID = intColumn("WeID") reference Organs.ID comment "بىز"
    val TheyID = intColumn("TheyID") reference Organs.ID comment "ئۇلار"
    val State = intColumn("State") unsigned true comment "ھالىتى"
    val AreaID = intColumn("AreaID") reference Areas.ID comment "سودا يۈز بەرگەن رايۇن"
    val PriceTableID = intColumn("PriceTableID") reference PriceTables.ID comment "باھا جەدۋىلى"
    val OrderID = intColumn("OrderID") comment "زاكاس جەدۋىلى تەرتىپ نومۇرى، -1 يوق ئىكەنلىكىنى بىلدۈرىدۇ"

    init {
        index(WeID)
        index(TheyID)
        index(State)
        index(AreaID)
        index(PriceTableID)

//        unique(ApplicationDomainID, WeID, TheyID, State, AreaID, PriceTableID)
    }
}